home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d998.lha / TeXPrt / source / strings.c < prev    next >
C/C++ Source or Header  |  1994-04-05  |  2KB  |  41 lines

  1.  
  2. /*----------------------------- INCLUDES ----------------------------------*/
  3.  
  4. #include "TexPrt_protos.h"
  5.  
  6. /***************************************************************************
  7.  *                                                                         *
  8.  *  Function name : repchrstr                                              *
  9.  *                                                                         *
  10.  *  Description : Replaces in a string a given character with another      *
  11.  *                given character.                                         *
  12.  *                                                                         *
  13.  ***************************************************************************
  14.  *                                                                         *
  15.  *  Synopsis : repchrstr ()                                                *
  16.  *                                                                         *
  17.  *  Parameters :                                                           *
  18.  *       (char *) string : The string pointer to string which has to be    *
  19.  *                         transformed.                                    *
  20.  *       (char) srchchar : The character which has to be replaced.         *
  21.  *       (char) repchar  ; The character which replaces the srchchar.      *
  22.  *                                                                         *
  23.  *  Return value : (char *)                                                *
  24.  *       Same pointer as string.                                           *
  25.  *                                                                         *
  26.  ***************************************************************************/
  27.  
  28. char *repchrstr (char *string, char srchchar, char repchar)
  29.  
  30. {
  31. char  *strp;
  32.  
  33.  
  34. strp = string;
  35. while (strp = strchr (strp, srchchar))
  36.    *strp = repchar;
  37.  
  38. return (string);
  39. }
  40.  
  41.